package com.suineg.pms.service.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.suineg.pms.entity.base.Company;
import com.suineg.pms.repository.base.CompanyDao;

/**
 *
 *@author Suine
 */
@Service
@Transactional(readOnly = true)
public class CompanyServcie {
	/** 日志输出对象 */
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	@Autowired
	private CompanyDao dao;
	
	public Company get(Long id){
		return dao.findOne(id);
	}
	
	public Company findByName(String name){
		return dao.findByName(name);
	}
	@Transactional(readOnly= false)
	public void save(Company company){
		dao.save(company);
	}
	@Transactional(readOnly= false)
	public void delete(Long id){
		dao.delete(id);
	}
}

